From 8085b410742b2183fd599221f90fff569048b7e8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 4 Jan 2014 21:48:19 -0500 Subject: [PATCH] GtkCheckMenuItemAccessible: Make work with model menu items GtkModelMenuItem does not emit the ::toggled signal when a radio item is activated, so listen for property notification for that property. We still keep the ::toggled signal handler, in order to not break other uses of check and radio menu items. https://bugzilla.gnome.org/show_bug.cgi?id=720983 --- gtk/a11y/gtkcheckmenuitemaccessible.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gtk/a11y/gtkcheckmenuitemaccessible.c b/gtk/a11y/gtkcheckmenuitemaccessible.c index 694fec4506..e0011f5a3a 100644 --- a/gtk/a11y/gtkcheckmenuitemaccessible.c +++ b/gtk/a11y/gtkcheckmenuitemaccessible.c @@ -84,10 +84,12 @@ gtk_check_menu_item_accessible_notify_gtk (GObject *obj, AtkObject *atk_obj; gboolean sensitive; gboolean inconsistent; + gboolean active; atk_obj = gtk_widget_get_accessible (GTK_WIDGET (check_menu_item)); sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)); inconsistent = gtk_check_menu_item_get_inconsistent (check_menu_item); + active = gtk_check_menu_item_get_active (check_menu_item); if (strcmp (pspec->name, "inconsistent") == 0) { @@ -100,6 +102,10 @@ gtk_check_menu_item_accessible_notify_gtk (GObject *obj, atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive); atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, (sensitive && !inconsistent)); } + else if (strcmp (pspec->name, "active") == 0) + { + atk_object_notify_state_change (atk_obj, ATK_STATE_CHECKED, active); + } else GTK_WIDGET_ACCESSIBLE_CLASS (gtk_check_menu_item_accessible_parent_class)->notify_gtk (obj, pspec); } -- 2.30.2